package com.liangzhong.model.court.vo
{
	import com.common.utils.Debug;
	import com.liangzhong.model.AppData;
	
	import flash.utils.ByteArray;

	/**
	 * 球场信息 
	 * @author Administrator
	 * 
	 */	
	public class CourtInfoVo
	{
		public function CourtInfoVo()
		{
		}
		
		/**
		 *球场等级 
		 */
		public var level :int;
		/**
		 *升级所需欧元 
		 */
		public var coin :int;
		/**
		 *升级所需等级 
		 */
		public var needlevel :int;
		/**
		 *上次升级看时间 
		 */
		public var pretime :int;
		/**
		 *门票收入 
		 */
		public var ticket :int;
		/**
		 *冷却时间 秒 
		 */		
		public var freezingTime			:Number = 12 * 60 * 60;
		
		/**
		 *解析信息 
		 * 
		 */
		public function analysis($data:Object):void
		{
			for(var str:String in $data)
			{
				if(this.hasOwnProperty(str))
					this[str] = $data[str];
				else
					Debug.echo("CourtInfoVo" + str + "属性");
			}
		}
		/**
		 *球场升级 
		 * @param buffer
		 * @return 
		 * 
		 */
		public function courtUp(buffer:ByteArray):void
		{
			level = buffer.readByte();
			coin = buffer.readInt();
			needlevel = buffer.readShort();
			ticket = buffer.readInt();
			pretime = AppData.getInstance().time
		}
	}
}